
package com.houxr;

import com.houxr.apis.HelloDubboService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Consumer {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring.xml"});
        context.start();
        // 获取远程服务代理
        HelloDubboService helloService = (HelloDubboService) context.getBean("helloDubboService");
        String hello = helloService.sayHello("侯秀荣"); // 执行远程方法

        System.out.println("======houxiurong==========:" + hello); // 显示调用结果
    }

}
